package ProjectYudisium;

import java.awt.*;
import java.awt.event.*;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;

public class FrameUtamaSekretariat extends JFrame {

    Container contentPane;
    private JLabel labeljdl1, labeljdl2, jdl, jd2;
    private JMenuBar menuBar;
    private JMenu checkDaftar, menuExit;
    public JMenuItem table, unggahan, exitFrame;
    private Random random;

    public FrameUtamaSekretariat() {
        setSize(600, 350);
        setLocation(375, 100);
        setTitle("FRAME SEKRETARIAT YUDISIUM");
        setResizable(true);
        setCursor(Cursor.HAND_CURSOR);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);

        menuBar = new JMenuBar();
        this.setJMenuBar(menuBar);

        checkDaftar = new JMenu("Cek Pendaftar");
        menuBar.add(checkDaftar);
        table = new JMenuItem("Identitas Pendaftar");
        checkDaftar.add(table);
        table.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                JDialog identitasMHS = new JDialog();
                PanelPeriksaYudisium panelPeriksa = new PanelPeriksaYudisium();
                identitasMHS.setSize(700, 600);
                identitasMHS.setLocation(300, 50);
//                unggahFile.add(panelPeriksa.tabelCekIdentitas());
                identitasMHS.add(panelPeriksa);
                identitasMHS.setVisible(true);
                dispose();
                //Menampilkan Frame yang di dalamnya terdapat Tabel yang sudah mendaftar Yudisium
            }
        });
        unggahan = new JMenuItem("Unggahan Pendaftar");
        checkDaftar.add(unggahan);
        unggahan.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                JDialog unggahFile = new JDialog();
                PanelPeriksaYudisium panelPeriksa = new PanelPeriksaYudisium();
                unggahFile.setSize(700, 600);
                unggahFile.setLocation(300, 50);
//                unggahFile.add(panelPeriksa.tabelCekUnggahan());
                unggahFile.add(panelPeriksa);
                unggahFile.setVisible(true);
                dispose();
            }
        });

        menuExit = new JMenu("BACK");
        menuBar.add(menuExit);
        exitFrame = new JMenuItem("to MENU UTAMA");
        menuExit.add(exitFrame);
        exitFrame.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                PengendaliYudisium main = new PengendaliYudisium();
                main.setVisible(true);
                dispose();
            }
        });

        contentPane = getContentPane();
        contentPane.setLayout(null);
        contentPane.setBackground(Color.lightGray);

        JLabel logo = new JLabel(new ImageIcon("Pictures/usd.gif"));
        logo.setBounds(20, 15, 150, 120);
        add(logo);

        labeljdl1 = new JLabel();
        Font font = new Font("Charlemagne Std", 1, 22);
        labeljdl1.setText("UNIVERSITAS SANATA DHARMA");
        labeljdl1.setBounds(165, 40, 600, 50);
        labeljdl1.setFont(font);
        add(labeljdl1);

        labeljdl2 = new JLabel();
        labeljdl2.setText("YOGYAKARTA");
        labeljdl2.setBounds(280, 75, 600, 50);
        labeljdl2.setFont(font);
        add(labeljdl2);

        jdl = new JLabel("PENDAFTARAN YUDISIUM");
        random = new Random();
        jdl.setFont(new Font("Algerian", 1, 40));
        jdl.setBackground(new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256)));
        jdl.setBounds(45, 40, 600, 300);
        add(jdl);

        jd2 = new JLabel("SEKRETARIAT");
        random = new Random();
        jd2.setFont(new Font("Algerian", 1, 50));
        jd2.setBackground(new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256)));
        jd2.setBounds(135, 90, 600, 300);
        add(jd2);
    }
}